Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dereferencing zeroth element of empty vector #97

Conversation

pbatko-ge
Copy link

This is undefined behavior. In MSVC results in failed assertion in debug build.

Note: std::vector::data is available since C++11. If you want to support pre-C++11 standards, this changes should be rewritten.

@pbatko-ge pbatko-ge force-pushed the fix-dereferencing-zeroth-element-of-empty-vector branch from fc424cf to 521a339 Compare April 19, 2024 06:32
@eichelberg
Copy link
Member

A (simpler) fix that does not require C++11 was committed today as commit #169030f5a.

@eichelberg eichelberg closed this May 17, 2024
michaelonken pushed a commit that referenced this pull request May 28, 2024
class DcmTLSCiphersuiteHandler contains two methods that sort a
list of ciphersuites. This caused an access violation of the list
to be sorted was empty (which could never happen with the command
line tools, but was possible in user code if no security profile
was activated). This is now fixed.

Thanks to Piotr Batko <Piotr.Batko@gehealthcare.com> for the bug report.
This closes GitHub pull request #97.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants